package model.dto.user;

import java.util.ArrayList;
import java.util.Iterator;

import db.DAOFactory;

import model.User;

/**
 * 
 * Description: 用于输出权限级别列表的DTO类。
 *  
 * @since  2009/3/3
 * @author ashen
 * 
 */
public class UserList {
	private ArrayList<model.dto.user.User> list;

	public UserList() {
		list=new ArrayList<model.dto.user.User>();
		ArrayList<User> tempList=DAOFactory.getUserDAO().findAll();
		for(Iterator i=tempList.iterator();i.hasNext();){
			this.addUser(new model.dto.user.User((model.User)i.next()));
		}
	}

	public UserList(ArrayList<model.dto.user.User> list) {
		this.list = list;
	}

	public ArrayList<model.dto.user.User> getList() {
		return list;
	}

	public void setList(ArrayList<model.dto.user.User> list) {
		this.list = list;
	}
	
	public void addUser(model.dto.user.User user) {
		this.list.add(user);
	}
	
}
